<!DOCTYPE html>
<html>
<head>
    {include file="layout:_meta" /}
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-fluid" style="padding-top: 20px">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" action="{:url('config/plugin')}">
                        <div class="layui-tab-content" >
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item">
                                    <label class="layui-form-label" style="width: 120px">脚本版本：</label>
                                    <div class="layui-input-block"  style="margin-left: 150px">
                                        <input type="text" name="version" placeholder="请输入脚本版本号" autocomplete="off" class="layui-input" value="{:isset($list['version'])?$list['version']:''}">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label" style="width: 120px">脚本开启：</label>
                                    <div class="layui-input-block"  style="margin-left: 150px">
                                        <input type="radio" name="open" value="1" title="开启"  {eq name="list.open" value="1"}checked{/eq} >
                                        <input type="radio" name="open" value="0" title="关闭" {eq name="list.open" value="0"}checked{/eq} >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-submit lay-filter="submit">确认</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="layout:_footer" /}
<script>
    layui.use(['form'], function(){
        var form = layui.form,$ = layui.$;

        //监听表单提交
        form.on('submit(submit)', function(data){
            layer.confirm('您确认要提交吗？', {
                btn: ['确认','取消'] //按钮
            }, function(index){
                $.post(data.form.action, data.field, function (res) {
                    var icon = 5;
                    if (res.code) {
                        icon = 6;
                    }
                    layer.msg(res.msg, {icon: icon, time: 1500});
                }, 'json');
            }, function(){
                layer.msg('已取消..');
                return false;
            });
            return false;
        });
    })
</script>
</body>
</html>
